package com.rykj.base.refreshview.data;


/**
 * Description: author: zhangsan on 2017/8/18 下午1:55.
 */

public interface IDataDelegate {


    void refresh();

    void refreshWithLoading();

    void destroy();

    void loadData(int loadAction);

    boolean isLoadWithEmptyView();

    /** 添加获取开始请求数据的监听 **/
    void addLoadActionInterceptor(loadActionInterceptor interceptor);

    /** 添加请求结果的监听 **/
    void addLoadResultInterceptor(loadResultInterceptor interceptor);

    IDataDelegate setDataSource(IDataSource dataSource);

    public  interface loadResultInterceptor<T> {
        void onLoadResult(int loadAction, T t);

        /** 是否拦截后续默认处理 如果返回true 表示 拦截后续放入adapter 操作 **/
        boolean shouldInterceptHanldle();
    }

    public interface loadActionInterceptor {
        boolean shouldOverrideRefresh();

        boolean shouldOverrideLoadMore();

        void onStartRefresh();

        void onStartLoadMore();
    }
}
